import request from '@/utils/request'

const libraryPrefix = '/library'

// 查询我的文档
export function libraryDocQueryMyDoc(args) {
  return request({
    url: libraryPrefix + '/LibraryDocInfo/queryMyDoc',
    method: 'POST',
    data: args
  })
}

// 查询所有文档
export function libraryDocQueryAllDoc(args) {
  return request({
    url: libraryPrefix + '/LibraryDocInfo/queryAllDoc',
    method: 'POST',
    data: args
  })
}

// 通过分类查询文档
export function libraryDocQuerybyCategory(args) {
  return request({
    url: libraryPrefix + '/LibraryDocInfo/querybyCategory/' + args.categoryId,
    method: 'POST',
    data: args
  })
}

// 上传文档
export function libraryDocUpload(args) {
  return request({
    url: libraryPrefix + '/LibraryDocInfo/upload',
    method: 'POST',
    data: args
  })
}

// 删除文档
export function libraryDocDelete(args) {
  return request({
    url: libraryPrefix + '/LibraryDocInfo/delete',
    method: 'DELETE',
    data: args
  })
}

// 批量删除文档
export function libraryDocDeleteBatch(args) {
  return request({
    url: libraryPrefix + '/LibraryDocInfo/delete/batch',
    method: 'DELETE',
    data: args
  })
}

// 更新文档
export function libraryDocUpdateDocById(args) {
  return request({
    url: libraryPrefix + '/LibraryDocInfo/updateDocById/' + args.id,
    method: 'PUT',
    data: args
  })
}

// 手动转化文档为PDF
export function libraryDocConvertToPDF(args) {
  return request({
    url: libraryPrefix + '/LibraryDocInfo/convertToPDF/byPrimaryKey/' + args.id,
    method: 'POST',
    data: args
  })
}

